using Lzfy_Refund_Service.Models;

namespace Lzfy_Refund_Service.Repositories
{
    /// <summary>
    /// UUM用户仓储接口
    /// </summary>
    public interface IUumUserRepository
    {
        /// <summary>
        /// 根据用户名查询UUM用户信息
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <returns>用户信息</returns>
        Task<UumUser?> GetUserByUserNameAsync(string userName);

        /// <summary>
        /// 根据用户ID查询UUM用户信息
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>用户信息</returns>
        Task<UumUser?> GetUserByIdAsync(int userId);

        /// <summary>
        /// 根据工号查询UUM用户信息
        /// </summary>
        /// <param name="peopleIdentifier">工号</param>
        /// <returns>用户信息</returns>
        Task<UumUser?> GetUserByPeopleIdentifierAsync(string peopleIdentifier);

        /// <summary>
        /// 检查用户名是否存在
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <returns>是否存在</returns>
        Task<bool> UserNameExistsAsync(string userName);

        /// <summary>
        /// 更新用户信息（仅更新task_amount、usertype、partybranch、userphone字段）
        /// </summary>
        /// <param name="request">更新请求</param>
        /// <returns>是否成功</returns>
        Task<bool> UpdateUserAsync(UumUserUpdateRequest request);

        /// <summary>
        /// 搜索用户信息
        /// </summary>
        /// <param name="request">搜索请求</param>
        /// <returns>搜索结果</returns>
        Task<IEnumerable<UumUserSearchItem>> SearchUsersAsync(UumUserSearchRequest request);
    }
}